package com.nanhai.buddhist.college.module.collegebase.dal.mysql.classroomcategory;

import java.util.*;

import com.nanhai.buddhist.college.framework.common.pojo.PageResult;
import com.nanhai.buddhist.college.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.nanhai.buddhist.college.framework.mybatis.core.mapper.BaseMapperX;
import com.nanhai.buddhist.college.module.collegebase.dal.dataobject.classroomcategory.ClassroomCategoryDO;
import org.apache.ibatis.annotations.Mapper;
import com.nanhai.buddhist.college.module.collegebase.controller.admin.classroomcategory.vo.*;

/**
 * 教室分类 Mapper
 *
 * @author 南海佛学院
 */
@Mapper
public interface ClassroomCategoryMapper extends BaseMapperX<ClassroomCategoryDO> {

    default PageResult<ClassroomCategoryDO> selectPage(ClassroomCategoryPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ClassroomCategoryDO>()
                .likeIfPresent(ClassroomCategoryDO::getTypeName, reqVO.getTypeName())
                .eqIfPresent(ClassroomCategoryDO::getTypeRemark, reqVO.getTypeRemark())
                .orderByDesc(ClassroomCategoryDO::getCreateTime));
    }

    default List<ClassroomCategoryDO> selectList(ClassroomCategoryExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<ClassroomCategoryDO>()
                .likeIfPresent(ClassroomCategoryDO::getTypeName, reqVO.getTypeName())
                .eqIfPresent(ClassroomCategoryDO::getTypeRemark, reqVO.getTypeRemark())
                .orderByDesc(ClassroomCategoryDO::getCreateTime));
    }

}
